# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MyBusinessBusinessInformation.V1.Model.Category do
  @moduledoc """
  A category describing what this business is (not what it does). For a list of valid category IDs, and the mappings to their human-readable names, see `categories.list`.

  ## Attributes

  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Output only. The human-readable name of the category. This is set when reading the location. When modifying the location, `category_id` must be set.
  *   `moreHoursTypes` (*type:* `list(GoogleApi.MyBusinessBusinessInformation.V1.Model.MoreHoursType.t)`, *default:* `nil`) - Output only. More hours types that are available for this business category.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. A stable ID (provided by Google) for this category. The value must be specified when modifying the category (when creating or updating a location).
  *   `serviceTypes` (*type:* `list(GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceType.t)`, *default:* `nil`) - Output only. A list of all the service types that are available for this business category.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :displayName => String.t() | nil,
          :moreHoursTypes =>
            list(GoogleApi.MyBusinessBusinessInformation.V1.Model.MoreHoursType.t()) | nil,
          :name => String.t() | nil,
          :serviceTypes =>
            list(GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceType.t()) | nil
        }

  field(:displayName)

  field(:moreHoursTypes,
    as: GoogleApi.MyBusinessBusinessInformation.V1.Model.MoreHoursType,
    type: :list
  )

  field(:name)

  field(:serviceTypes,
    as: GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceType,
    type: :list
  )
end

defimpl Poison.Decoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.Category do
  def decode(value, options) do
    GoogleApi.MyBusinessBusinessInformation.V1.Model.Category.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.Category do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
